package com.th.supcom.pds.impl.manager.impl;

import java.util.List;
import java.util.Map;

import net.carefx.fc.framework.db.manager.GetSequenceHelper;

import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.th.supcom.pds.domain.pojo.PdsPatPhamRemain;
import com.th.supcom.pds.impl.dao.PdsPatPhamRemainMapper;
import com.th.supcom.pds.impl.manager.PdsPatPhamRemainManager;

/**
 * PdsPatPhamRemain 管理接口实现.
 * 
 * 患者药品剩余数量表.
 */
public class PdsPatPhamRemainManagerImpl implements PdsPatPhamRemainManager
{
    public static final String TAB_PDS_PAT_PHAM_REMAIN = "PDS_PAT_PHAM_REMAIN";

    private PdsPatPhamRemainMapper m_pdsPatPhamRemainMapper;

    /** 序列生成器. */
    private GetSequenceHelper m_getSequenceHelper;

    /**
     * 默认的构造函数.
     */
    public PdsPatPhamRemainManagerImpl ()
    {

    }

    /**
     * 获取PdsPatPhamRemainMapper.
     * 
     * @return PdsPatPhamRemainMapper.
     */
    public PdsPatPhamRemainMapper getPdsPatPhamRemainMapper ()
    {
        return m_pdsPatPhamRemainMapper;
    }

    /**
     * 注入PdsPatPhamRemainMapper.
     * 
     * @param pdsPatPhamRemainMapper set pdsPatPhamRemainMapper.
     */
    public void setPdsPatPhamRemainMapper (PdsPatPhamRemainMapper pdsPatPhamRemainMapper)
    {
        m_pdsPatPhamRemainMapper = pdsPatPhamRemainMapper;
    }

    /**
     * 获取序列.
     * 
     * @return GetSequenceHelper
     */
    public GetSequenceHelper getGetSequenceHelper ()
    {
        return m_getSequenceHelper;
    }

    /**
     * 注入序列.
     * 
     * @param getSequenceHelper getSequenceHelper.
     */
    public void setGetSequenceHelper (GetSequenceHelper getSequenceHelper)
    {
        m_getSequenceHelper = getSequenceHelper;
    }

    @Override
    public PdsPatPhamRemain getPdsPatPhamRemainByID (Long id)
    {
        return m_pdsPatPhamRemainMapper.getPdsPatPhamRemainByID (id);
    }

    @Override
    public Long getPdsPatPhamRemainSeq ()
    {
        return m_getSequenceHelper.getNextSequenceId (TAB_PDS_PAT_PHAM_REMAIN);
    }

    @Override
    public List <PdsPatPhamRemain> findPatPhamRemainsByPaiVisitIdList (List <Long> paiVisitIdList)
    {
        return m_pdsPatPhamRemainMapper.findPatPhamRemainsByPaiVisitIdList (paiVisitIdList);
    }

    @Override
    public List <PdsPatPhamRemain> findPdsPatPhamRemainListByExample (PdsPatPhamRemain pdsPatPhamRemain)
    {
        return m_pdsPatPhamRemainMapper.findPdsPatPhamRemainListByExample (pdsPatPhamRemain);
    }

    @Override
    public int findPdsPatPhamRemainCountByExample (PdsPatPhamRemain pdsPatPhamRemain)
    {
        return m_pdsPatPhamRemainMapper.findPdsPatPhamRemainCountByExample (pdsPatPhamRemain);
    }

    @Override
    public List <PdsPatPhamRemain> findPdsPatPhamRemainListByMap (Map <String, Object> params)
    {
        return m_pdsPatPhamRemainMapper.findPdsPatPhamRemainListByMap (params);
    }

    @Override
    public List <PdsPatPhamRemain> findPdsPatPhamRemainPagingByMap (Map <String, Object> params, Integer offset, Integer limit)
    {
        return m_pdsPatPhamRemainMapper.findPdsPatPhamRemainPagingByMap (new RowBounds (offset, limit), params);
    }

    @Override
    public Integer findPdsPatPhamRemainCountByMap (Map <String, Object> params)
    {
        return m_pdsPatPhamRemainMapper.findPdsPatPhamRemainCountByMap (params);
    }

    @Override
    public int modifyPdsPatPhamRemain (PdsPatPhamRemain pdsPatPhamRemain)
    {
        return m_pdsPatPhamRemainMapper.modifyPdsPatPhamRemain (pdsPatPhamRemain);
    }

    @Override
    public int modifyPdsPatPhamRemainByExample (PdsPatPhamRemain pdsPatPhamRemain)
    {
        return m_pdsPatPhamRemainMapper.modifyPdsPatPhamRemainByExample (pdsPatPhamRemain);
    }

    @Override
    public int removePdsPatPhamRemainByID (Long id)
    {
        return m_pdsPatPhamRemainMapper.removePdsPatPhamRemainByID (id);
    }

    @Override
    public int removePdsPatPhamRemainByMap (Map <String, Object> params)
    {
        return m_pdsPatPhamRemainMapper.removePdsPatPhamRemainByMap (params);
    }

    @Override
    public void addPdsPatPhamRemain (PdsPatPhamRemain pdsPatPhamRemain)
    {
        pdsPatPhamRemain.setId (getPdsPatPhamRemainSeq ());
        m_pdsPatPhamRemainMapper.addPdsPatPhamRemain (pdsPatPhamRemain);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.th.supcom.pds.impl.manager.PdsPatPhamRemainManager#
     * addPdsPatPhamRemainList(java.util.List)
     */
    @Override
    public void addPdsPatPhamRemainList (List <PdsPatPhamRemain> list)
    {
        for (PdsPatPhamRemain pdsPatPhamRemain : list)
        {
            pdsPatPhamRemain.setId (getPdsPatPhamRemainSeq ());
        }
        m_pdsPatPhamRemainMapper.addPdsPatPhamRemainList (list);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.th.supcom.pds.impl.manager.PdsPatPhamRemainManager#
     * modifyPdsPatPhamRemainList(java.util.List)
     */
    @Override
    public int modifyPdsPatPhamRemainList (List <PdsPatPhamRemain> list)
    {
        return m_pdsPatPhamRemainMapper.modifyPdsPatPhamRemainList (list);
    }

    /** 日志记录器. */
    public static final Logger s_logger = LoggerFactory.getLogger (PdsPatPhamRemainManagerImpl.class);

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";
}